//
// Created by Administrator on 2022/1/2 0002.
//
#include <iostream>
#include <cstring>
#include "t_mystr.h"

//测试字符串
void test_mystr(){
    using namespace std;
//    C-style strcpy
    char food[20] = "carrots";
    strcpy(food,"flan");
    cout<<food<<endl;
//    C-style strncpy
    strncpy(food,"a picnic basket filled with many goodies",19);
    food[19] = '\0';
    cout<<food<<endl;

    string cpp_str = "hsj is smart!";
    cpp_str = "hsx also smart!";
    cout<<cpp_str<<endl;
}
